package com.lemo.mybatis.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.lemo.mybatis.model.Lemo;
import com.lemo.mybatis.service.LemoService;

@RestController
@RequestMapping("/lemo")
public class LemoController {

	@Autowired
	private LemoService lemoService;

	@RequestMapping("add")
	public String add() {
		Lemo lemo = new Lemo();
		lemo.setLid(1L);
		lemo.setLname("demo1");
		return lemoService.insertSelective(lemo) > 0 ? "成功" : "失败";
	}
	
	@RequestMapping("/delete")
	public String delete() {
		Lemo lemo = new Lemo();
		lemo.setLname("demo1");
		return lemoService.deleteByPrimaryKey(1L) > 0 ? "成功" : "失败";
	}
}
